package oli.plugmgr.events
{
	import flash.events.Event;
	
	import oli.plugpack.core.PlugIn;
	
	public class PlugRegEvent extends Event
	{
		public static const PLUGREG:String = "plugin registered";
		
		private var _plugin:PlugIn;
		
		public function PlugRegEvent(type:String, plugin:PlugIn = null, bubbles:Boolean = false, cancelable:Boolean = false)
		{
			_plugin= plugin;
			super(type, bubbles, cancelable);
		}

		public function get plugin():PlugIn
		{
			return _plugin;
		}
		public function set plugin(p:PlugIn):void
		{
			_plugin = p;
		}
		override public function clone():Event
		{
			return new PlugRegEvent(type, plugin, bubbles, cancelable);
		}
		override public function toString():String
		{
			return formatToString("PlugRegEvent","type","plugin","bubbles","cancelable","eventPhase");
		}
	}
}